Skip to content

Conversation

@MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli commented Jan 13, 2026

I'm open to comments here, I'd just like to suggest using Pyright to check type compelteness in CI. NumPy do something similar but they have their stubs as part of their package so for them it's a lot simpler: https://github.com/numpy/numpy/blob/89776e23e188438637b636651ff3ce0df4bd2097/tools/pyright_completeness.py

This is different from checking type correctness. The existing jobs already cover that. This only checks that publicly exported symbols in pandas have known types

I had to rework a handful of imports due to microsoft/pyright#11196, which I haven't received a response on (yet?)

@MarcoGorelli MarcoGorelli marked this pull request as ready for review January 13, 2026 11:00
Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK with this. But I think it would be useful to have some documentation in docs/tests.md that explains how to run this locally (assuming it can). And, if so, can it be hooked into the poe structure for consistency?

subprocess.run(cmd, check=True)


def type_completeness() -> None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How long does that step take? It could be worth adding to the test_all step that one would run locally when developing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like it's 2 minutes 26 seconds 😩

I know that pyrefly also wants to add this functionality, and maybe we can get ty to add it too, so hopefully there'll be a faster way to check this is in the future

do you still want it in test_all or is this too slow?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 min is a bit long i would say, I think you would agree too, the mypy step is quite time consuming too so maybe that would add too much friction. Otherwise we could add it in the same style as the nightly steps, so only when we merge, open to options.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 min is a bit long i would say, I think you would agree too, the mypy step is quite time consuming too so maybe that would add too much friction. Otherwise we could add it in the same style as the nightly steps, so only when we merge, open to options.

Doesn't need to be in test_all, but one should be able to run it locally. Not sure if that is already in there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it would be already there, I think with the time it takes it is better to just run it on GitHub CI and not in test_all to reduce friction (it is fine if CI takes a bit of time)>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, poetry run poe type_completeness runs

@cmp0xff
Copy link
Contributor

cmp0xff commented Jan 16, 2026

/pyright_strict

@cmp0xff
Copy link
Contributor

cmp0xff commented Jan 23, 2026

Side comment: the PR prefix RFC is not in the list in https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#making-a-pull-request.

@cmp0xff cmp0xff requested a review from Dr-Irv January 23, 2026 13:15
@MarcoGorelli MarcoGorelli changed the title RFC: Ensure 100% type-completeness (according to Pyright), check it in CI Ensure 100% type-completeness (according to Pyright), check it in CI Jan 23, 2026
@MarcoGorelli MarcoGorelli changed the title Ensure 100% type-completeness (according to Pyright), check it in CI TST: Ensure 100% type-completeness (according to Pyright), check it in CI Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants